package nxu.it.movieapi.service.impl;

import nxu.it.api.model.Comment;
import nxu.it.movieapi.service.MovieCommentService;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
public class MovieCommentServiceImpl implements MovieCommentService {

    // 模拟数据库存储
    private final List<Comment> commentRepository = new ArrayList<>();

    @Override
    public Comment commentOnMovie(String movieId, String content, Integer rating, String userId) {
        Comment comment = new Comment();
        /*comment.setCommentId(UUID.randomUUID().toString());
        comment.setMovieId(movieId);
        comment.setUserId(userId);
        comment.setContent(content);
        comment.setRating(rating);
        comment.setCreatedAt(ZonedDateTime.now());*/

        // 存储评论到模拟数据库
        commentRepository.add(comment);

        return comment;
    }
}
